package com.app.service.teacher.impl;

import com.app.mapper.teacher.login.TeacherLoginMapper;
import com.app.pojo.Teacher;
import com.app.service.teacher.TeacherLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class TeacherLoginServiceImpl implements TeacherLoginService {

    @Autowired
    TeacherLoginMapper teacherLoginMapper;

    @Override
    public Teacher login(String userId, String password) {
        Teacher teacher = teacherLoginMapper.login(userId);
        if(teacher==null){
            return null;
        }else if(teacher.getPassword().equals(password)){
            return teacher;
        }
        return null;
    }
}
